package com.jianganming.chain;

public class LoginService {

    public void login(Member member){
        //构建调用链路
        Handler.Builder builder = new Handler.Builder();
        builder.addHandler(new ValidateHandler())
                .addHandler(new AuthHandler())
                .addHandler(new LoginSuccess());

        builder.build().doHandler(member);

    }

    public static void main(String[] args) {
        new LoginService().login(new Member("admin","admin123","管理员"));
    }
}
